<?php
class Complatetime {
	private $ftime,$settingreview,$ftime_d,$complatetime=array(),$test;
	public function __construct($ftime,$settingreview){
		$this->ftime = $ftime;
		$this->settingreview = $settingreview;
		$this->ftime_d = date('Y-m-d',strtotime("$ftime"));
	}
	public function getComplatetime(){
		$this->complatetime[0] = date('Y-m-d H:i',strtotime("$this->ftime + 5 minute"));
		$this->complatetime[1] = date('Y-m-d H:i',strtotime("$this->ftime + 30 minute"));
		$this->complatetime[2] = date('Y-m-d H:i',strtotime("$this->ftime + 12 hour"));
		foreach ($this->settingreview as $key => $value) {
			if($value['times'] == "4"){
				$this->test = $this->ftime_d." ".$value['review_date'];
				$this->complatetime[3] = date('Y-m-d H:i',strtotime("$this->test + 1 day"));
			}elseif($value['times'] == "5"){
				$this->test = $this->ftime_d." ".$value['review_date'];
				$this->complatetime[4] = date('Y-m-d H:i',strtotime("$this->test + 2 day"));
			}elseif($value['times'] == "6"){
				$this->test = $this->ftime_d." ".$value['review_date'];
				$this->complatetime[5] = date('Y-m-d H:i',strtotime("$this->test + 4 day"));
			}elseif($value['times'] == "7"){
				$this->test = $this->ftime_d." ".$value['review_date'];
				$this->complatetime[6] = date('Y-m-d H:i',strtotime("$this->test + 7 day"));
			}elseif($value['times'] == "8"){
				$this->test = $this->ftime_d." ".$value['review_date'];
				$this->complatetime[7] = date('Y-m-d H:i',strtotime("$this->test + 15 day"));
			}
		}
		return $this->complatetime;
	}
}